<?php

namespace app\im\controller;

use app\im\service\UserService;

class Register extends Controller
{
    public function index()
    {
        $account = input('account', '');
        $password = input('password', '');
        $service = new UserService();
        $res = $service->register($account, $password);

        return $res !== false ? resp_success([], '注册成功') : resp_fail('账号已存在');
    }
}
